package com.ls.hnks.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

import lombok.Data;

/**
 * 日程
 * @TableName tb_schedule
 */
@TableName(value ="tb_schedule")
@Data
public class Schedule implements Serializable {
    /**
     * ID,自增
     */
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    /**
     * 开始时间，必选
     */
    private Date starttime;

    /**
     * 结束时间，必选
     */
    private Date endtime;

    /**
     * 服务内容，必选
     */
    private String content;

    /**
     * 服务对象，可选
     */
    private Integer customerid;

    /**
     * 状态，1，未完成，2完成，3，不处理，默认1，连续添加任务要记住上一次的状态
     */
    private Integer statusid;

    /**
     * 服务执行人，非管理人员，服务执行人和创建者一样
     */
    private Integer executorid;

    /**
     * 创建者ID，
     */
    private Integer createuserid;

    /**
     * 提醒时间，0：不提醒，1：15分钟前，2：30分钟前，3：1小时前，4：6小时前，5：一天前
     */
    private Integer remindtype;

    /**
     * 备注
     */
    private String other;

    /** 删除标志（0代表存在 1代表删除） */
    private String deleteflag;

    /**
     * 创建时间
     */
    private Date createtime;

    /**
     * 服务执行人名称
     */
    @TableField(exist = false)
    private String  executorName;

    /**
     * 图片列表
     */
    @TableField(exist = false)
    private List<SchedulePic> schedulePicList;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Schedule other = (Schedule) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getStarttime() == null ? other.getStarttime() == null : this.getStarttime().equals(other.getStarttime()))
            && (this.getEndtime() == null ? other.getEndtime() == null : this.getEndtime().equals(other.getEndtime()))
            && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
            && (this.getCustomerid() == null ? other.getCustomerid() == null : this.getCustomerid().equals(other.getCustomerid()))
            && (this.getStatusid() == null ? other.getStatusid() == null : this.getStatusid().equals(other.getStatusid()))
            && (this.getExecutorid() == null ? other.getExecutorid() == null : this.getExecutorid().equals(other.getExecutorid()))
            && (this.getCreateuserid() == null ? other.getCreateuserid() == null : this.getCreateuserid().equals(other.getCreateuserid()))
            && (this.getRemindtype() == null ? other.getRemindtype() == null : this.getRemindtype().equals(other.getRemindtype()))
            && (this.getOther() == null ? other.getOther() == null : this.getOther().equals(other.getOther()))
            && (this.getCreatetime() == null ? other.getCreatetime() == null : this.getCreatetime().equals(other.getCreatetime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getStarttime() == null) ? 0 : getStarttime().hashCode());
        result = prime * result + ((getEndtime() == null) ? 0 : getEndtime().hashCode());
        result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
        result = prime * result + ((getCustomerid() == null) ? 0 : getCustomerid().hashCode());
        result = prime * result + ((getStatusid() == null) ? 0 : getStatusid().hashCode());
        result = prime * result + ((getExecutorid() == null) ? 0 : getExecutorid().hashCode());
        result = prime * result + ((getCreateuserid() == null) ? 0 : getCreateuserid().hashCode());
        result = prime * result + ((getRemindtype() == null) ? 0 : getRemindtype().hashCode());
        result = prime * result + ((getOther() == null) ? 0 : getOther().hashCode());
        result = prime * result + ((getCreatetime() == null) ? 0 : getCreatetime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", starttime=").append(starttime);
        sb.append(", endtime=").append(endtime);
        sb.append(", content=").append(content);
        sb.append(", customerid=").append(customerid);
        sb.append(", statusid=").append(statusid);
        sb.append(", executorid=").append(executorid);
        sb.append(", createuserid=").append(createuserid);
        sb.append(", remindtype=").append(remindtype);
        sb.append(", other=").append(other);
        sb.append(", createtime=").append(createtime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}